home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gxchar.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  5.3 KB  |  130 lines

  1. /* Copyright (C) 1989, 1995, 1997, 1998, 1999 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gxchar.h,v 1.2 2000/09/19 19:00:34 lpd Exp $ */
  20. /* Internal character definition for Ghostscript library */
  21. /* Requires gsmatrix.h, gxfixed.h */
  22.  
  23. #ifndef gxchar_INCLUDED
  24. #  define gxchar_INCLUDED
  25.  
  26. #include "gschar.h"
  27. #include "gxtext.h"
  28.  
  29. /* The type of cached characters is opaque. */
  30. #ifndef cached_char_DEFINED
  31. #  define cached_char_DEFINED
  32. typedef struct cached_char_s cached_char;
  33. #endif
  34.  
  35. /* The type of cached font/matrix pairs is opaque. */
  36. #ifndef cached_fm_pair_DEFINED
  37. #  define cached_fm_pair_DEFINED
  38. typedef struct cached_fm_pair_s cached_fm_pair;
  39. #endif
  40.  
  41. /* The type of font objects is opaque. */
  42. #ifndef gs_font_DEFINED
  43. #  define gs_font_DEFINED
  44. typedef struct gs_font_s gs_font;
  45. #endif
  46.  
  47. /* The types of memory and null devices may be opaque. */
  48. #ifndef gx_device_memory_DEFINED
  49. #  define gx_device_memory_DEFINED
  50. typedef struct gx_device_memory_s gx_device_memory;
  51. #endif
  52. #ifndef gx_device_null_DEFINED
  53. #  define gx_device_null_DEFINED
  54. typedef struct gx_device_null_s gx_device_null;
  55. #endif
  56.  
  57. /* An enumeration object for string display. */
  58. typedef enum {
  59.     sws_none,
  60.     sws_cache,            /* setcachedevice[2] */
  61.     sws_no_cache,        /* setcharwidth */
  62.     sws_cache_width_only    /* setcharwidth for xfont char */
  63. } show_width_status;
  64. struct gs_show_enum_s {
  65.     /* Put this first for subclassing. */
  66.     gs_text_enum_common;    /* (procs, text, index) */
  67.     /* Following are set at creation time */
  68.     bool auto_release;        /* true if old API, false if new */
  69.     gs_state *pgs;
  70.     int level;            /* save the level of pgs */
  71.     gs_char_path_mode charpath_flag;
  72.     gs_state *show_gstate;    /* for setting pgs->show_gstate */
  73.                 /* at returns/callouts */
  74.     int can_cache;        /* -1 if can't use cache at all, */
  75.                 /* 0 if can read but not load, */
  76.                 /* 1 if can read and load */
  77.     gs_int_rect ibox;        /* int version of quick-check */
  78.                 /* (inner) clipping box */
  79.     gs_int_rect obox;        /* int version of (outer) clip box */
  80.     int ftx, fty;        /* transformed font translation */
  81.     /* Following are updated dynamically */
  82.     gs_glyph (*encode_char)(P3(gs_font *, gs_char, gs_glyph_space_t));  /* copied from font */
  83.     gs_log2_scale_point log2_suggested_scale;    /* suggested scaling */
  84.                 /* factors for oversampling, */
  85.                 /* based on FontBBox and CTM */
  86.     gx_device_memory *dev_cache;    /* cache device */
  87.     gx_device_memory *dev_cache2;    /* underlying alpha memory device, */
  88.                 /* if dev_cache is an alpha buffer */
  89.     gx_device_null *dev_null;    /* null device for stringwidth */
  90.     /*uint index; */        /* index within string */
  91.     /*uint xy_index;*/        /* index within X/Y widths */
  92.     /*gs_char returned.current_char;*/    /* current char for render or move */
  93.     /*gs_glyph returned.current_glyph;*/    /* current glyph ditto */
  94.     gs_fixed_point wxy;        /* width of current char */
  95.                 /* in device coords */
  96.     gs_fixed_point origin;    /* unrounded origin of current char */
  97.                 /* in device coords, needed for */
  98.                 /* charpath and WMode=1 */
  99.     cached_char *cc;        /* being accumulated */
  100.     /*gs_point returned.total_width;*/        /* total width of string, set at end */
  101.     show_width_status width_status;
  102.     /*gs_log2_scale_point log2_scale;*/
  103.     int (*continue_proc) (P1(gs_show_enum *));    /* continuation procedure */
  104. };
  105. #define gs_show_enum_s_DEFINED
  106. /* The structure descriptor is public for gschar.c. */
  107. #define public_st_gs_show_enum() /* in gxchar.c */\
  108.   gs_public_st_composite(st_gs_show_enum, gs_show_enum, "gs_show_enum",\
  109.     show_enum_enum_ptrs, show_enum_reloc_ptrs)
  110.  
  111. /* Cached character procedures (in gxccache.c and gxccman.c) */
  112. #ifndef gs_font_dir_DEFINED
  113. #  define gs_font_dir_DEFINED
  114. typedef struct gs_font_dir_s gs_font_dir;
  115.  
  116. #endif
  117. cached_char *
  118.             gx_alloc_char_bits(P7(gs_font_dir *, gx_device_memory *, gx_device_memory *, ushort, ushort, const gs_log2_scale_point *, int));
  119. void gx_open_cache_device(P2(gx_device_memory *, cached_char *));
  120. void gx_free_cached_char(P2(gs_font_dir *, cached_char *));
  121. void gx_add_cached_char(P5(gs_font_dir *, gx_device_memory *, cached_char *, cached_fm_pair *, const gs_log2_scale_point *));
  122. void gx_add_char_bits(P3(gs_font_dir *, cached_char *, const gs_log2_scale_point *));
  123. cached_char *
  124.             gx_lookup_cached_char(P5(const gs_font *, const cached_fm_pair *, gs_glyph, int, int));
  125. cached_char *
  126.             gx_lookup_xfont_char(P6(const gs_state *, cached_fm_pair *, gs_char, gs_glyph, const gx_xfont_callbacks *, int));
  127. int gx_image_cached_char(P2(gs_show_enum *, cached_char *));
  128.  
  129. #endif /* gxchar_INCLUDED */
  130.